#!perl
my $rd = shift;
# http://mysite.verizon.net/aesir_research/date/inrata.htm

my $z = $rd + 306;
my $g = $z - 0.25;
my $a = int($g / 36524.25);
my $b = $a - int($a / 4);
my $year = int(($b + $g) / 365.25);
my $c = $b + $z - int(365.25 * $year);
my $month =
month = FIX((5 * C + 456) / 153) 	step 6
day = C - FIX((153 * month - 457) / 5)	step 7 and 8
IF month > 12 THEN	step 9
       year = year + 1	step 9
       month = month - 12	step 9
END IF	step 9
